//
//  UIBarButtonItem+YKExtension.m
//  baisi
//
//  Created by 吴高烽 on 16/8/30.
//  Copyright © 2016年 吴高烽. All rights reserved.
//

#import "UIBarButtonItem+YKExtension.h"

@implementation UIBarButtonItem (YKExtension)
+(instancetype)itemWithImage:(NSString*)image selectImage:(NSString*)selectImage target:(id)target action:(SEL)action{
    UIButton *settingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [settingBtn setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [settingBtn setImage:[UIImage imageNamed:selectImage] forState:UIControlStateHighlighted];
    settingBtn.size = settingBtn.currentImage.size ;
    [settingBtn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return [[self alloc]initWithCustomView:settingBtn];
}
@end
